﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<script runat="server">
    protected void Button1_Click(object sender, EventArgs e)
    {

    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        if (CheckBox1.Checked)
            lblError.Text = "No puede modificar un registro cuya fecha es menor a la actual.";
        else if (CheckBox2.Checked)
            Response.Redirect("~/ModificarItinerario.aspx");    
        else
        {   
            lblError.Text = "";
        }
    }

    protected void Button3_Click(object sender, EventArgs e)
    {
        if (CheckBox1.Checked)
        {
            /*DateTime objDateTime = DateTime.Parse("17/09/2012");
            if (objDateTime < DateTime.Now)*/
                lblError.Text = "No puede anular un registro cuya fecha es menor a la actual.";
            /*else
                lblError.Text = "";*/
        }
        if (CheckBox2.Checked)
        {
            Response.Redirect("~/ItinerarioViajesAnulado.aspx");    
        }
        else
        {
            lblError.Text = "Debe seleccionar el registro a anular.";
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button4_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/ItinerarioViajesBusqueda.aspx");
    }
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server">
<div></div>
<div>
    <asp:Label ID="Label1" runat="server" Text="Destinos" Font-Bold="True" 
        Font-Size="Medium"></asp:Label></div>
<div></div>
<div>
    <table>
        <tr>
            <td>
                <asp:Label ID="Label2" runat="server" Text="Fecha"></asp:Label>
            </td>
            <td>
                <asp:Label ID="Label3" runat="server" Text=":"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextBox2" runat="server" Width="83px"></asp:TextBox>
            </td>
            <td>
            </td>
            <td>
                <asp:Label ID="Label4" runat="server" Text="Origen"></asp:Label>
            </td>
            <td>
                <asp:Label ID="Label5" runat="server" Text=":"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextBox1" runat="server" Width="107px"></asp:TextBox>
            </td>
            <td>
            </td>
            <td>
                <asp:Label ID="Label6" runat="server" Text="Destino"></asp:Label>
            </td>
            <td>
                <asp:Label ID="Label7" runat="server" Text=":"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="TextBox3" runat="server" Width="108px"></asp:TextBox>
            </td>
            <td></td>
            <td><asp:Button ID="Button4" runat="server" Text="Buscar" onclick="Button4_Click" /></td>
        </tr>
    </table>
</div>
<div></div>
<div>
            <table>
                <tr>
                    <td bgcolor="#CCCCFF" style="font-weight: bold"></td>
                    <td bgcolor="#CCCCFF" style="font-weight: bold">Fecha</td>
                    <td bgcolor="#CCCCFF" style="font-weight: bold">Hora</td>
                    <td bgcolor="#CCCCFF" style="font-weight: bold">Origen</td>
                    <td bgcolor="#CCCCFF" style="font-weight: bold">Destino</td>
                    <td bgcolor="#CCCCFF" style="font-weight: bold">Bus</td>
                    <td bgcolor="#CCCCFF" style="font-weight: bold">Chofer</td>
                    <td bgcolor="#CCCCFF" style="font-weight: bold">Brevete</td>
                </tr>
                <tr>
                    <td>
                        <asp:CheckBox ID="CheckBox1" runat="server" />
                    </td>
                    <td>17/09/2012</td>
                    <td>15:30</td>
                    <td>Lima</td>
                    <td>Cuzco</td>
                    <td>T3E-969</td>
                    <td>Pedro Florez Martínez</td>
                    <td>458169784</td>
                </tr>
                <tr>
                    <td>
                        <asp:CheckBox ID="CheckBox2" runat="server" />
                    </td>
                    <td>27/09/2012</td>
                    <td>10:00</td>
                    <td>Lima</td>
                    <td>Chimbote</td>
                    <td>T3E-326</td>
                    <td>Martín Santos Lorenzo</td>
                    <td>469632569</td>
                </tr>
                <tr>
                    <td>
                        <asp:CheckBox ID="CheckBox3" runat="server" />
                    </td>
                    <td>28/09/2012</td>
                    <td>08:00</td>
                    <td>Puno</td>
                    <td>Lima</td>
                    <td>T3E-741</td>
                    <td>César Cruzado Ulloa</td>
                    <td>478524539</td>
                </tr>
                <tr>
                    <td>
                        <asp:CheckBox ID="CheckBox4" runat="server" />
                    </td>
                    <td>28/09/2012</td>
                    <td>09:50</td>
                    <td>Tacna</td>
                    <td>Ica</td>
                    <td>T3E-548</td>
                    <td>Juan Ávila Ochoa</td>
                    <td>489652175</td>
                </tr>
            </table>
</div>
<div></div>
<div>
            <asp:Button ID="Button1" runat="server" Text="Registrar" 
                onclick="Button1_Click" />
            <asp:Button ID="Button2" runat="server" Text="Modificar" 
                onclick="Button2_Click" />
            <asp:Button ID="Button3" runat="server" Text="Anular" onclick="Button3_Click" />
</div>
    
<div></div>
<div><asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label></div>
<div></div>
    </form>
</asp:Content>
